﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using RAP.Web.Libary.AppStatup;

namespace RAP.Web.Core.Server
{
  /// <summary>
  /// 
  /// </summary>
  public class WebEnvironment : IAppEnvironment
  {

    /// <summary>
    /// 
    /// </summary>
    /// <param name="env"></param>
    public WebEnvironment(IWebHostEnvironment env)
    {
      EnvironmentName = env.EnvironmentName;
      ApplicationName = env.ApplicationName;
      AppRootPath = env.WebRootPath;
      AppRootFileProvider = env.WebRootFileProvider;
      ContentRootPath = env.ContentRootPath;
      ContentRootFileProvider = env.ContentRootFileProvider;
      IsDevelopment = env.IsDevelopment();
      IsProduction = env.IsProduction();
    }
    public string EnvironmentName { get; set; }

    public string ApplicationName { get; set; }

    public string AppRootPath { get; set; }

    public IFileProvider AppRootFileProvider { get; set; }

    public string ContentRootPath { get; set; }

    public IFileProvider ContentRootFileProvider { get; set; }

    public bool IsDevelopment { get; set; }

    public bool IsProduction { get; set; }
  }
}
